package com.laosg.spring.small.core02.factory.support;

import com.laosg.spring.small.core02.factory.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>description: some thing </p>
 *
 * @author kevin
 * @date 8/17/21
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {
    private Map<String,Object> singletonObjects=new HashMap<>();



    @Override
    public Object getSingleton(String beanName) {
        return singletonObjects.get(beanName);
    }

    protected void addSingleton(String beanName,Object singletonObject) {
        singletonObjects.put(beanName, singletonObject);
    }

}
